package cn.com.gridinfo.sooc.core.expand.score.fragment;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import butterknife.ButterKnife;
import butterknife.InjectView;
import cn.com.gridinfo.sooc.R;
import cn.com.gridinfo.sooc.base.BaseSoocFragment;
import cn.com.gridinfo.sooc.utils.PagerAdapter;

/**
 * 提现详情
 * Created by yingchunli on 2016/4/16.
 */
public class TxInfoFragment extends BaseSoocFragment {

    View view;
    private String tabTx[] = {"全部", "成功", "审核", "失败"};
    PagerAdapter adapter;//适配器
    @InjectView(R.id.sliding_tabs_mycounts)
    TabLayout tabLayout;//标签栏
    @InjectView(R.id.viewpager_mycounts)
    ViewPager mViewPager;//ViewPager

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.expand_score_counts_tx, null);
        ButterKnife.inject(this, view);

        //初始化界面
        adapter = new PagerAdapter(this.getChildFragmentManager());
        for (int i = 0; i < tabTx.length; i++) {
            adapter.addFragment(TxInfoDetailFragment.newInstance(i + ""), tabTx[i]);
            tabLayout.addTab(tabLayout.newTab().setText(tabTx[i]));
        }
        mViewPager.setAdapter(adapter);
        tabLayout.setupWithViewPager(mViewPager);

        return view;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.reset(this);
    }

}
